#!/usr/bin/php
<?php
#$file = "/home/liujikun/develop/datas/out.xml";
$file = "/home/liujikun/develop/datas/gbk.xml";
$reader = new XMLReader();
$reader->open( $file );
while( $reader->read() ) {
    switch( $reader->nodeType ) {
    case XMLReader::ELEMENT:
        printf("node name = %s\n", $reader->name );
        break;
    case XMLReader::END_ELEMENT:
        printf("end node name = %s\n", $reader->name );
        break;
    case XMLReader::CDATA:
        printf("CData\n");
        break;
    }
}
$reader->close();
?>
